package com.test.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import org.apache.commons.codec.binary.Base64;

/**
 * 加密算法类
 * @ClassName: Encrypt 
 * @Description: TODO 
 * @author weiqi 
 * @date 2017年3月22日 下午9:08:33
 */
public class Encrypt {
	private static String de = "<qaslbeu?asd}[asd[asd";
	public static String EncodMd5(String arg){
		try {
			MessageDigest md = MessageDigest.getInstance("md5");
			String str = de+arg;
			byte md5[] = md.digest(str.getBytes());
			Base64 base64 = new Base64();
			return base64.encodeToString(md5);
		} catch (NoSuchAlgorithmException e){
			throw new RuntimeException(e);
		}
	}

}
